package com.shadowtorcher.dragonstreasure.url;

import java.util.TreeMap;

public class URL {
    private final static Integer METHOD = 0;
    private final static Integer MY_URL = 2;
    private final static Integer ACTION = 3;
    protected TreeMap<Integer, String> map = new TreeMap<>();

    public URL(StringBuffer stringBuffer) {
        String[] str = stringBuffer.toString().split("/");
        map.put(METHOD, str[METHOD]);
        map.put(MY_URL, str[MY_URL]);
        map.put(ACTION, str[ACTION]);
    }

    public URL() {
    }

    public String getMethod() {
        return map.get(METHOD);
    }

    public void setMethod(String method) {
        map.put(METHOD, method);
    }

    public String getMyURL() {
        return map.get(MY_URL);
    }

    public void setMyUrl(String myUrl) {
        map.put(MY_URL, myUrl);
    }

    public String getAction() {
        return map.get(ACTION);
    }

    public void setAction(String action) {
        map.put(ACTION, action);
    }
}
